package fristphase.day04;

public class MyExtend {
    public static void main(String[] args) {
        Doo o1 = new Doo();
        Boo o = new Boo(2,3);
        System.out.println("result="+o.Add());
    }
}
class Coo{
    Coo(){
        System.out.println("a");
    }
}
class Doo extends Coo{
    Doo(){
//        super(5);//没有super()调用超类构造，则默认调用super()
    }
}
class Aoo{
    int a,b,result;
    Aoo(int a,int b){
        this.a = a;
        this.b = b;
        System.out.println("超类的构造方法");
    }
    int Add(){
        return result = a+b;
    }
}
class Boo extends Aoo{
    Boo(int a,int b){
        super(a,b);
        System.out.println("派生类的构造方法");
    }
}